
<!----------------------- ADD FRIEND SUCCESSFULLY --------------------------->
<div id="accept-friend-success" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-header">
	<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
	<h3 id="myModalLabel">Accept friend Successfully</h3>
    </div>
    <div class="modal-body">
	<div class="alert alert-success"><strong>Congratulation!</strong> You have accepted friend successfully.	    
	</div>
    </div>
    <div class="modal-footer">
	<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>	
    </div>
</div>
<div class="left">
    <div class="wrap-page">
	<div class="title-page"><strong>Friends</strong></div>	
	<?php $this->renderPartial('_menu'); ?>
	<div class="content-page">
	    <?php
	    $this->widget('bootstrap.widgets.TbGridView', array(
		'id' => 'post-grid',
		'dataProvider' => $model->search(user()->id, 'incoming'),
		'filter' => $model,
		'columns' => array(
		    array(
			'header' => 'Avatar',
			'type' => 'raw',
			'value' => function($data) {
			    return '<img src ="' . $data->user->getAvatarUrl('small') . '"/>';
			}
		    ),
		    array(
			'header' => 'Username',
			'name' => 'senderName',
			'value' => '$data->user->username',
		    ),
		    array(
			'header' => 'Date sent',
			'name' => 'time_created',
			'type' => 'raw',
			'value' => function($data) {
			    return date('m-d-Y', strtotime($data->time_created));
			},
			'filter' => false,
		    ),
		    array(
			'type' => 'raw',
			'value' => function($data) {
			    return "<a href='#accept-friend-success' class='add-one-friend' user-id='" . $data->user_send . "'><i class='icon-ok'></i> Confirm Friend Request</a>";
			},
			'htmlOptions' => array(
			    'width' => 180
			)
		    ),
		    array(
			'class' => 'bootstrap.widgets.TbButtonColumn',
			'template' => '{delete}',
			'buttons' => array(
			    'delete' => array(
				'url' => 'Yii::app()->controller->createUrl("friend/delete_request", array("sender"=>$data->user_send,"receiver"=>$data->user_receive))',
			    ),
			    'view' => array(
				'url' => 'Yii::app()->controller->createUrl("user/view", array("id"=>$data->user_send))',
			    )
			),
		    )
		),
	    ));
	    ?>
	</div>
    </div>
</div>
<div class="right">
    <div class="box-right">
	<?php $this->widget('application.widgets.loginbox.LoginBox'); ?>

    </div><!--box-right-->
    <?php $this->widget('application.widgets.ad.Ad') ?>
</div><!--right-->